package com.randi.framework.domain.vo;

import com.randi.common.core.domain.dto.TreeNode;
import com.randi.common.core.domain.entity.SysMenu;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 侧边菜单项
 *
 * @author ziye
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@ApiModel(value = "MenuVo", description = "菜单项")
public class RouterMenu extends TreeNode {

    @ApiModelProperty(value = "key")
    private String key;

    @ApiModelProperty(value = "菜单项标题")
    private String label;

    @ApiModelProperty(value = "菜单图标")
    private String icon;

    public RouterMenu(SysMenu sysMenu) {
        this.id = sysMenu.getMenuId();
        this.parentId = sysMenu.getParentId();
        this.key = sysMenu.getMenuPath();
        this.icon = sysMenu.getMenuIcon();
        this.label = sysMenu.getMenuName();
    }

}
